package com.example.sys.speciality.vo;

import com.example.core.vo.BaseAuthVo;
import com.example.sys.speciality.po.SysSpeciality;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

@Setter
@Getter
public class SysSpecialityVo extends BaseAuthVo<SysSpecialityVo> {

    private String userId;

    private List<SysSpeciality> sysSpecialities = new ArrayList<>();

    private List<String> categoryIds = new ArrayList<>();

    private List<String> categoryNames = new ArrayList<>();

    public SysSpecialityVo() {
    }

    public SysSpecialityVo(List<SysSpeciality> sysSpecialities) {
        this.sysSpecialities = sysSpecialities;
        if (!this.sysSpecialities.isEmpty()) {
            for (SysSpeciality sysSpeciality : this.sysSpecialities) {
                this.categoryIds.add(sysSpeciality.getCategoryId());
            }
        }
        if (!this.sysSpecialities.isEmpty()) {
            for (SysSpeciality sysSpeciality : this.sysSpecialities) {
                this.categoryNames.add(sysSpeciality.getCategoryName());
            }
        }
    }
}
